#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long LL;
typedef double db;
inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') { if(ch=='-')f=-1; ch=getchar(); }
	while(ch>='0'&&ch<='9') { x=(x<<1)+(x<<3)+ch-'0'; ch=getchar(); }
	return x*f;
}
const int MAXN=1e5+10;
int n,m,q,head[MAXN],head1[MAXN*2],cnt,dis[MAXN],dfn[MAXN],low[MAXN],tim,fa[17][MAXN*2],top,sum[MAXN],dep[MAXN*2],tot;
bool vis[MAXN];
struct edge
{
	int v,next,val;
}e[MAXN*10];
struct edge1
{
	int v,next;
}e1[MAXN*10];
struct node
{
	int u,v,val;
}stac[MAXN];
void addedge(int x,int y,int z)
{
	e[++cnt]=(edge){y,head[x],z};
	head[x]=cnt;
	return;
}
void addedge1(int x,int y)
{
	e1[++cnt]=(edge1){y,head1[x]};
	head1[x]=cnt;
	return;
}
void SPFA()
{
	memset(dis,INF,sizeof(dis));
	queue<int>q;
	q.push(1);
	vis[1]=true;
	dis[1]=0;
	while(!q.empty())
	{
		int u=q.front();q.pop();
		vis[u]=false;
		for(int i=head[u];i;i=e[i].next)
		{
			int v=e[i].v;
			if(dis[v]>dis[u]+e[i].val)
			{
				dis[v]=dis[u]+e[i].val;
				if(!vis[v])
				{
					q.push(v);
					vis[v]=true;
				}
			}
		}
	}
	return;
}
void loop(int root)
{
	addedge1(root,++tot);
	fa[0][tot]=root;
	sum[tot]+=stac[top].val;
	sum[stac[top].u]=stac[top].val;
	--top;
	while(true)
	{
		node i=stac[top--];
		addedge1(tot,i.v);
		sum[tot]+=i.val;
		sum[i.u]=sum[i.v]+i.val;
		fa[0][i.v]=tot;
		if(i.u==root)break;
	}
	return;
}
void tarjan(int u,int lst)
{
	dfn[u]=low[u]=++tim;
	for(int i=head[u];i;i=e[i].next)
	{
		int v=e[i].v;
		if(v==u||v==lst)continue;
		if(!dfn[v])
		{
			stac[++top]=(node){u,v,e[i].val};
			tarjan(v,u);
			low[u]=min(low[u],low[v]);
			if(low[v]>=dfn[u])
			{
				if(stac[top].v==v)
				{
					addedge1(u,v);
					fa[0][v]=u;
					--top;
					continue;
				}
				loop(u);
			}
		}
		else if(dfn[v]<low[u])
		{
			low[u]=dfn[v];
			stac[++top]=(node){u,v,e[i].val};
		}
	}
	return;
}
void dfs(int u)
{
	for(int i=head1[u];i;i=e1[i].next)
	{
		int v=e1[i].v;
		dep[v]=dep[u]+1;
		dfs(v);
	}
	return;
}
int LCA(int u,int v,int &son1,int &son2)
{
	if(dep[v]>dep[u])swap(u,v);
	for(int i=16;~i;--i)
		if(dep[fa[i][u]]>=dep[v])
			u=fa[i][u];
	if(u==v)return u;
	for(int i=16;~i;--i)
		if(fa[i][u]!=fa[i][v])
			u=fa[i][u],v=fa[i][v];
	son1=u,son2=v;
	return fa[0][u];
}
int main()
{
	n=read();m=read();q=read();
	for(int i=1;i<=m;++i)
	{
		int x=read(),y=read(),z=read();
		addedge(x,y,z);addedge(y,x,z);
	}
	SPFA();
	tot=n;
	cnt=0;
	tarjan(1,0);
	dep[1]=1;
	dfs(1);
	fa[0][1]=1;
	for(int i=1;i<=16;++i)
		for(int j=1;j<=tot;++j)
			fa[i][j]=fa[i-1][fa[i-1][j]];
	while(q--)
	{
		int x=read(),y=read();
		int son1,son2,lca=LCA(x,y,son1,son2);
		if(lca<=n)printf("%d\n",dis[x]+dis[y]-2*dis[lca]);
		else
			printf("%d\n",dis[x]+dis[y]-dis[son1]-dis[son2]+min(abs(sum[son1]-sum[son2]),sum[lca]-abs(sum[son1]-sum[son2])));
	}
	return 0;
}
